home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1993 November / JCSM Shareware Collection - 1993-11.iso / cl720 / vxbase1j.lzh / VXBTUT1.FRM (.txt) < prev    next >
Visual Basic Form  |  1993-04-28  |  12KB  |  312 lines

  1. vxbtut1
  2. Business Card Directory Browse
  3. Form2%
  4. MemoBox
  5. ButtonExit
  6. E&xit
  7. ButtonIndex
  8. &Order
  9. ButtonAgain
  10. A&gain
  11. ButtonSearch
  12. &Search
  13. ButtonDelete
  14. &Delete
  15.     ButtonAdd
  16. ButtonEdit
  17. &Edit
  18.     BrowseBox
  19. Form_Click
  20.     Form_Load
  21. OpenFileS
  22. Enabled
  23. FALSE
  24. ExitMenu
  25. PckFile
  26. PackFile
  27. vxFilter
  28. vxTop
  29. vxEof
  30. EditMode
  31. ADDING(
  32. vxbtut2?
  33. vxTableDeclare
  34. VX_RED3
  35. vxTableFieldO
  36. VX_EXPRt
  37. VX_FIELD
  38. vxBrowseCase
  39. VX_UPPER
  40. vxBrowseSetupL
  41. TRUEY
  42. VX_SEMIBOLD0
  43. StateDbf
  44. vxUseDbf
  45. StateNtx
  46. vxUseNtx%
  47. vxSelectDbfb
  48. DbfAreao
  49. vxSelectNtx
  50. NtxArea2
  51. Form_Paint
  52. vxFormFramef
  53. vxbtut1
  54. hWndJ
  55. vxCtlStyle
  56.     BrowseBox
  57.     VX_RECESS
  58. MemoBoxf
  59. vxCtlBrowse+
  60.     vxCtlHwnd
  61. NtxArea1n
  62. Form_Resize
  63. Form_Unload
  64. Cancel
  65. vxCtlBrowseMsgH
  66.     VXB_CLOSE
  67. vxCloseAll
  68. vxWindowDereg
  69. ButtonExit_Clickn
  70. ButtonEdit_Click
  71. UPDATING
  72. RecNum
  73. VXB_GETCURRENTREC
  74. vxGoy
  75. BrowseBox_Change
  76. BrowseBox_KeyPress    
  77. KeyAscii
  78. ButtonAdd_Click
  79. VXB_REFRESH
  80. TopRec
  81. VXB_GETTOPREC
  82. vxRecNum
  83. ButtonDelete_Clickb
  84. DELETING
  85. DeleRec3
  86. vxbtut0"
  87. vxRecNo
  88. VX_GRAY
  89. vxBrowsePos
  90. MousePointer
  91. frame9
  92. BrowseBox_KeyDown
  93. KeyCode
  94. Shift
  95. button
  96. StatBox
  97. StatBar
  98. firstN
  99. keydown*
  100. fromM
  101. NewRec
  102. vxAppendBlank
  103. vxReplString
  104. CoBox|
  105. vxWrite8
  106. ButtonAgain_Click
  107. pointer
  108. added
  109.     FirstTime
  110. ButtonIndex_ClickV
  111. NtxAr
  112. NtxArea2
  113.     CANCELLED
  114.     TopRecNum
  115. vxbasea
  116. version
  117. less/
  118. vxLockRecordz
  119. vxDeleteRec%
  120. vxUnlock>
  121. ElseDeleRec
  122. ButtonSearch_Click
  123. SeekStr
  124.     contained
  125. browse
  126. VXB_SEARCHPRG
  127. ButtonAgain
  128. VXB_SEARCHAGAIN00
  129. VXB_SEARCHAGAIN
  130.     vxNumRecs
  131. hardware
  132. Form_QueryUnload
  133. UnloadModeS
  134. BrowseRunning
  135. MemoBox_Change
  136. Form_LostFocus
  137. ButtonEdit_KeyPress
  138. ButtonAgain_KeyDownI
  139. vxTableReset
  140. BofExpr
  141. EofExpr
  142. vxSeek4
  143. newkey
  144. vxField
  145. oldkey
  146. vxBrowseArray
  147.  static switch set to TRUE in form
  148.  load procedure so we know when this
  149.  form is first loaded 
  150. BrowseBox_KeyDown
  151.  whenever a record is highlighted, thist
  152.  proc receives a middle button codec
  153.  from the ctlBrowse so we can dynamicallya
  154.  display data in another text box if we like
  155.  middle button?w
  156. Record Number 
  157.  if INSERT key is pressed, emulate
  158.  Add Button pressr
  159.  If DELETE key is pressed, emulate
  160.  Delete button press
  161. BrowseBox_KeyPress
  162.  if ENTER key is received (also sent byt
  163.  double clicking), then edit the recordc
  164.  NOTE: YOU MUST ALWAYS TRAP THE ENTER KEY
  165.  AND CHANGE THE KEYASCII CODE TO
  166.  A ZERO WHEN USING VXCTLBROWSE
  167.  EVEN IF YOU DON'T USE IT-
  168.  if ESC key is received, then emulatel
  169.  exit button press
  170. ButtonAdd_Click
  171.  set global so edit form knows what we're doing)
  172.  get browse top rec so if user cancels add
  173.  we have some place to restart the browseo
  174.  show edit form as modal so it has to be dealt
  175.  with before we come back here
  176.  If user didn't cancel, get current record
  177.  pointer. It will be the new record.
  178.  restart the browse with either the new 
  179.  record or the old top recorde
  180. activity
  181. SOFTWARE
  182. activity
  183. company
  184. activity
  185. company
  186. ButtonAgain_Click
  187.  search for same string againg
  188. ButtonDelete_Click
  189.  save current browse state
  190. Deleting record 
  191.  Issue confirmation message for delete
  192. Confirm Delete
  193.  if yes, then delete the recordl
  194.  lock the record before deleting
  195.  check to see if there are any records
  196.  leftk
  197.  if all gone, eof will
  198.  be true
  199.  else set up NEXTN
  200.  rec for restart
  201.  pretend user cancelled 
  202.  if we can't locke
  203.  user is cancelling deletion
  204.  no records left
  205.  user cancelled delete
  206.  restart the browseo
  207. Record Number 
  208. ButtonEdit_Click
  209.  set global so edit form knows what we're doingo
  210.  get current and top records so we haveh
  211.  some place to go when we come back here
  212.  position record pointer for edit form
  213.  always use a modal form for editing
  214.  because we don't want the user to
  215.  click on the browse window and mess everythingh
  216.  up while we are editing the recordc
  217.  restart browse at old top recordc
  218.  use code below if you want the browse display
  219.  to restart at the edited record instead of the
  220.  old top record and comment out line above.e
  221.  (close old browse to clear the screen because
  222.   the new top position may be near the end of the 
  223.   file and there may not be enough records leftl
  224.   to overwrite any old ones that were in the
  225.   table)
  226.  k& = vxCtlBrowseMsg(vxCtlHwnd(BrowseBox), VXB_CLOSE, 0)
  227.  j% = vxCtlBrowse(vxCtlHwnd(BrowseBox), DbfArea, NtxArea1, 0, RecNum&, vxCtlHwnd(MemoBox), "bmemo").
  228. ButtonExit_Click
  229.  on exit, unload this form
  230. ButtonIndex_Click
  231.  swap index order in the browse box-
  232.  close the browse
  233.  swap the indexes and change the table slightly-
  234.  so if activity index, activity shows first
  235.  release browse table memory
  236. Activity
  237. left(activity,20)
  238. Company
  239. left(company,20)
  240. Phone
  241. phone
  242. State
  243. state
  244. Country
  245. country
  246.  re-open the browse in the new order
  247. bmemo
  248. Company
  249. left(company,20)
  250. Phone
  251. phone
  252. Activity
  253. left(activity,20)
  254. State
  255. state
  256. Country
  257. country
  258.  re-open the browse in the new order
  259. bmemo
  260.  display dynamic data for first show of the browse
  261. Record Number 
  262. ButtonSearch_Click
  263.  search for a string passed by the user that
  264.  is contained within the browse tablea
  265. Search string?
  266. Search for String
  267. Form_Load
  268.  set FirstTime switch on for Paint
  269.  Disable menu items that could interfere
  270.  search again button is disabled because
  271.  we haven't specified a search string yet 
  272.  register the default database as the master
  273.  we'll call the browse first time always
  274.  using NtxArea1. The "Order" button will
  275.  change the index to the one currently NOT
  276.  selectedh
  277.  set up the browse
  278. Company
  279. left(company,20)
  280. Phone
  281. phone
  282. Activity
  283. left(activity,20)
  284. State
  285. state
  286. Country
  287. country
  288.  If the typeface is too large on your display,
  289.  CHANGE the parameter following "Helv" above toe
  290.  a smaller numberm
  291.  change the mouse pointer in the browse box 
  292.  from an I-Beam to an arrow to stop any flickerc
  293. Form_Paint
  294.  register the database with this windown
  295.  make the form 3-d
  296.  initiate the browse the first time only
  297. bmemo
  298.  on initial paint of the browse, middle button
  299.  keydown is not sent to browse box so we wantw
  300.  to do our dynamic display here as well as
  301.  from a keydown in the browse box code
  302. Record Number 
  303. Form_Resize
  304.  if form is resized, redraw so old
  305.  frame is erased
  306. Form_Unload
  307.  close the browse-
  308.  close all the files
  309.  deregister the window and release memorym
  310.  Re-enable menu items on controller form
  311.  clear status bar 
  312.